#include "Blocks/SwitchBlock.h"

namespace PocketSurvival
{
    int32_t SwitchBlock::getIndex()
    {
        return Index();
    }
    const std::string &SwitchBlock::getBlockName()
    {
        static std::string blockName = "SwitchBlock";
        return blockName;
    }

    int32_t SwitchBlock::getFace(int32_t value)
    {
        return (Terrain::ExtractData(value) >> 1) & 7;
    }

    const std::vector<BoundingBox> &SwitchBlock::getCustomCollisionBoxes(int32_t value)
    {
        int32_t num = CalculateIndex(value);
        if(num < GET_ARRAY_LEN(BlockConstans::switchCollisionBoxes))
        {
            return BlockConstans::switchCollisionBoxes[num];
        }
        return BlockConstans::zeroCollisionBoxes;
    }
}